<?php
if(!isset($model)) 
	$model = new UserLogin();

$this->pageTitle=Yii::app()->name . ' - '.Yii::t("UserModule.user", "Login");
$this->breadcrumbs=array(
	Yii::t("UserModule.user", "Login"),
);
?>

<b> <?php echo Yii::t("UserModule.user", "当前操作: 登录"); ?> </b>
<span class="note"> <?php	echo Yii::t("UserModule.user", 'Whole Required'); ?></span>

<?php if(Yii::app()->user->hasFlash('loginMessage')): ?>
  <div class="success">
    <?php echo Yii::app()->user->getFlash('loginMessage'); ?>
  </div>
<?php endif; ?>

<div class="form form-left">
<?php echo CHtml::beginForm(); ?>

	<?php echo CHtml::errorSummary($model); ?>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'username'); ?>
		<?php echo CHtml::activeTextField($model,'username') ?>
	</div>
	
	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'password'); ?>
		<?php echo CHtml::activePasswordField($model,'password') ?>
	</div>
	
	<div class="row rememberMe">
		<?php echo CHtml::activeCheckBox($model,'rememberMe'); ?>
		<?php echo CHtml::activeLabelEx($model,'rememberMe'); ?>
	</div>

	<div class="row submit">
		<?php echo CHtml::submitButton(Yii::t("UserModule.user", "Login")); ?>
	</div>
	
  <?php echo CHtml::endForm(); ?>
</div><!-- form -->

<!--Right-->
<div class="form-right">
  <p>
    <b>如果您还不是会员?</b>
    <br/>
    <span style="line-height:26px;">
      &crarr; <?php echo CHtml::link(Yii::t("UserModule.user", "点此注册"), $this->module->registrationUrl)?>
    </span>
  </p>
  <p>
    <b>如果您忘记密码?</b>
    <br/>
    <span style="line-height:26px;">
      &crarr; <?php echo CHtml::link(Yii::t("UserModule.user", "找回密码"), $this->module->recoveryUrl)?>
    </span>
  </p>
</div>
<!--End Right-->

<?php
$form = new CForm(array(
    'elements'=>array(
        'username'=>array(
            'type'=>'text',
            'maxlength'=>32,
        ),
        'password'=>array(
            'type'=>'password',
            'maxlength'=>32,
        ),
        'rememberMe'=>array(
            'type'=>'checkbox',
        )
    ),

    'buttons'=>array(
        'login'=>array(
            'type'=>'submit',
            'label'=>'Login',
        ),
    ),
), $model);
?>
